package cn.aeolia.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * 员工表实体类
 *
 * @author aeolia
 */
@Data
@NoArgsConstructor
@ToString
public class Employee {
    private Integer id;
    private String name;
    /**
     * 0:女 1：男
     */
    private Integer gender;
    private String email;
    private Date birth;

    private Department department;


    public Employee(Integer id, String name, Integer gender, String email, Department department) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.email = email;
        //默认创建日期
        this.birth = new Date();
        this.department = department;
    }

    public String getDataFormatBirth(){
        return new SimpleDateFormat("yyyy年MM月dd日").format(birth);
    }
}
